#设置最低版本要求
cmake_minimum_required(VERSION 3.18)
#包含项目名称
project(ctestmymath VERSION 1.0.0 LANGUAGES CXX)
#开启测试功能
include(CTest)
#生成可执行文件
add_executable(main test.cpp)
#查找mymath库
find_package(mymath CONFIG REQUIRED)
#链接mymath库
target_link_libraries(main PRIVATE mymath::mymath)
#将测试添加到ctest
add_test(NAME testmymath COMMAND main)
#导出到指定目录
set_target_properties(main PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 

#打包
include(CPack)